export class Config {
  constructor(configData) {
    this.configData = configData;
  }

  get(key, defaultValue) {
    const keys = key.split('.');
    console.log("🚀 ~ config.js:8 ~ Config ~ get ~ keys:", keys)
    let result = this.configData;
    console.log("🚀 ~ config.js:10 ~ Config ~ get ~ result:", result)
    for (let i = 0; i < keys.length; i++) {
      if (result[keys[i]] !== undefined) {
        result = result[keys[i]];
      } else {
        return defaultValue;
      }
    }
    return result;
  }
}
